package ch5;

import java.util.Scanner;

public class NumberTriangle {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入一个数字（1-9）：");

		int num = in.nextInt();
		for (int i = 1; i <= num; i++) {
			// 先打印空心倒三角
			// 再打印数字
			for (int j = 1; j <= num - i; j++) {
				System.out.print(" ");
			}
			for (int t = 1; t <= (i * 2 - 1); t++) {
				System.out.print(i);
			}
			System.out.println();
		}
	}

}
